package com.service.sms.controller;

import com.service.sms.service.SmsService;
import com.service.utils.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(description = "短信发送")
public class SmsController {

    @Autowired
    private SmsService smsService;

    /**
     * 短信发送
     * @param Mobile
     * @return
     */
    @GetMapping("sendSms/{Mobile}")
    @ApiOperation("短信发送接口")
    public ResultVo sendSms(@ApiParam(name = "Mobile",value = "手机号",required = true) @PathVariable String Mobile){
        Boolean flag = smsService.sendSms(Mobile);
        if (flag){
            return ResultVo.ok();
        }
        return ResultVo.error();
    }


}
